<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript" src="../lib/jquery.js"></script>
    <script>
        function getMsg(callback) {
            $.get('http://www.liulongbin.top:3006/api/robot', {
                spoke: '你好'
            }, function(res) {
                callback(res.data.info.text);
            });
        }

        function changeVoice(callback, msg) {
            $.get('http://www.liulongbin.top:3006/api/synthesize', {
                text: msg
            }, function(res) {
                console.log(res);
            })
        }
        getMsg(function(msg) {
            changeVoice(function(voice) {
                console.log(voice)
            }.msg)
        })
    </script>
</body>

</html>